<%@ page language="java" contentType="text/html;charset=UTF-8" %><%@ include file="../../inc/global.jsp" 
%>
<!doctype html>
<html>
<head>
<title>${adminGlobalConfig.name}</title>
<%@include file="../head.jsp" %>
<script type="text/javascript">
$(function(){
	$("#q").focus();
	$('.shcount').poshytip({
		className: 'tip-yellowsimple',
		alignTo: 'target',
		alignX: 'center',
		alignY: 'top',
		showTimeout: 10,
		offsetY: 5	,
		content:function(callback){
			var gid=$(this).attr('id').substring(2);
			$.ajax({
				url:'/a/ajax/store/house/count'
				,data:{gid:gid}
				,success:function(data){
					callback(data);
				}
			});
			return '正在查询库房...';
		}
	});
	$('.shcount').hover(function(){
		var gid = $(this).attr('id').substring(2);
		
	});
});
</script>
<style type="text/css">
.cbx{margin:7px 0px 0px 0px}
.cbx span{
	margin:0px 3px 7px 3px;
}
.shcount{cursor:pointer; color:#000099;}
.storehouseList em{margin:7px 3px; padding:3px 7px; background:#fff;}
</style>
</head>
<body>
<div class="wrapper">
<%@include file="../header.jsp" %>
<div class="body">
<div class="list">
<div class="listnav">
<form action="" method="get">
<input type="text" id="q" name="q" value="${q}" style="width:180px;" class="input"/>
<input type="submit" name="" value="<fmt:message key="message.find.sure" />" />
</form>
</div>
<table>
<thead>
<tr>
<th class="brand"><fmt:message key="message.brand.name" /></th>
<th class="category"><fmt:message key="message.category.name" /></th>
<th class="type"><fmt:message key="message.goods.name" /></th>
<th><fmt:message key="message.goods.price" /></th>
<th><fmt:message key="message.storehouse.latestInTime" /></th>
<th>库存</th>
<c:if test="${STORE_HOUSE_VIEW}">
<th><fmt:message key="message.storehouse.dispatch" /></th>
</c:if>
<c:if test="${SELL_MODIFY}">
<th>銷售</th>
</c:if>
<c:if test="${STORE_VIEW_BATCH}">
<th>详细</th>
</c:if>
<c:if test="${STORE_BACKTRACK}">
<th><fmt:message key="message.return.goods" /></th>
</c:if>
</tr>
</thead>
<tbody>
<c:if test="${empty goodsVOList}">
<tr>
<td></td>
<td></td>
<td></td>
<td></td>
<td>暂无记录...</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
</c:if>
<c:forEach var="item" items="${goodsVOList}" varStatus="s">
<c:if test="${(s.index % 2) != 0}">
<tr class="trbg">
</c:if>
<c:if test="${(s.index % 2) == 0}">
<tr>
</c:if>
<td>
<a href="/a/store/list?bid=${item.brandId}">${item.brandName}</a>
</td>
<td>
<a href="/a/store/list?cid=${item.categoryId}"">${item.categoryName}</a>
</td>
<td>
<a href="/a/batch/list?gid=${item.id}" title="${item.displayName}">${item.name}</a>
<c:forEach var="val" items="${item.propValues}"> / ${val.propValueName} </c:forEach>
</td>
<td><span class="price">${item.price}</span></td>
<td><fmt:formatDate pattern="yy-MM-dd" value="${item.latestStore}" /></td>
<td>
<c:choose>
<c:when test="${item.total>0}">
<span class="shcount" id="sh${item.id}">[${item.total}]</span>
</c:when>
<c:otherwise>
<c:if test="${STORE_MODIFY}">
<a href="/a/store/form?gid=${item.id}&bid=${item.brandId}&cid=${item.categoryId}&backURL=${backURL}">添加</a>
</c:if>
</c:otherwise>
</c:choose>
</td>
<td><a href="/a/store/dispatch?gid=${item.id}"><fmt:message key="message.storehouse.dispatch" /></a></td>
<c:if test="${SELL_MODIFY}">
<td>
<c:if test="${item.total>0}">
<a href="/a/sell/form?sgid=${item.id}&backURL=/a/sell/list">銷售</a>
</c:if>
<c:if test="${item.total<=0}">
没有库存了
</c:if>
</td>
</c:if>
<c:if test="${STORE_VIEW_BATCH}">
<td>
<a href="/a/batch/list?gid=${item.id}">详细</a>
</td>
</c:if>
<c:if test="${STORE_BACKTRACK}">
<td>
<c:if test="${item.total>0}">
<a href="/a/store/backtrack/form?gid=${item.id}&backURL=${backURL}"><fmt:message key="message.return.goods" /></a>
</c:if>
<c:if test="${item.total<=0}">
<fmt:message key="message.return.goods" />
</c:if>
</td>
</c:if>
</tr>
</c:forEach>
</tbody>
</table>
${pagination}
</div>
<div class="sidebarMenu">
<c:if test="${STORE_MODIFY}">
<ul>
<li><a href="/a/store/form?backURL=${backURL}">添加库存</a></li>
</ul>
</c:if>
</div>
<%@ include file="sidebar.jsp" %>
</div>
</div>
</body>
</html>